package org.dydl.controller.system;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ExceptionController {
	@RequestMapping("/exception")
	public void catchException() {
		throw new RuntimeException("error occur");
	}

	@RequestMapping("/500")
	public String showServerError() {
		return "500 server error";
	}

	@RequestMapping("/404")
	public String showNotFoundError() {
		return "404 Not Found!";
	}

	@RequestMapping("/403")
	public String showForbiddenError() {
		return "403 FORBIDDEN!";
	}

	// @RequestMapping("/401")
	// public ModelAndView showUnauthorizedError (RedirectAttributes attr) throws
	// Exception {
	// attr.addFlashAttribute("msg", "test");
	// Map<String, Object> map = new HashMap<String, Object>();
	// map.put("msg", "testq");
	// return new ModelAndView("redirect:/public/login.html", map);
	// }

}